<% provide(:title, '视频管理') %>
<div class="row">
  <div class="col-lg-12">
    <h1 class="page-header">视频后台管理</h1>
  </div>
</div>
<div class="row">
  <div class="col-lg-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <%= link_to '新建视频', new_admin_video_path, class: ' btn btn-success' %>
      </div>
      <!-- /.panel-heading -->
      <div class="panel-body">
        <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-videople">
          <thead>
          <tr>
            <th>视频标题</th>
            <th>视频简介</th>
            <th>发布时间</th>
            <th>删除操作</th>
          </tr>
          </thead>
          <tbody>
          <% @videos.each do |video| %>
              <tr>
                <td class="center"><%= video.name.capitalize %></td>
                <td class="center"><%= video.context.capitalize %></td>
                <td class="center"><%= video.created_at.strftime("%Y-%m-%d %H:%M:%S") %></td>
                <td class="center">
                  <%= link_to '删除', admin_video_path(video), method: :delete, data: {confirm: "你确定？"} %>
                </td>
              </tr>
          <% end %>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>